<template>
  <div class="SecondJump"></div>
</template>

<script>
export default {
  mounted() {
    let sUserAgent = navigator.userAgent.toLowerCase();

    var isIphone = sUserAgent.match(/iphone/i) == "iphone";
    var vx = sUserAgent.match(/MicroMessenger/i) == "micromessenger";
    var qq = sUserAgent.match(/QQ/i) == "micromessenger";
    var isHuawei = sUserAgent.match(/huawei/i) == "huawei";
    var isHonor = sUserAgent.match(/honor/i) == "honor";
    var isOppo = sUserAgent.match(/oppo/i) == "oppo";
    var isOppoR15 = sUserAgent.match(/pcam00/i) == "pcam00";
    var isVivo = sUserAgent.match(/vivo/i) == "vivo";
    var isXiaomi = sUserAgent.match(/xiaomi/i) == "xiaomi";
    var isXiaomi2s = sUserAgent.match(/mix\s/i) == "mix ";
    var isRedmi = sUserAgent.match(/redmi/i) == "redmi";
    var isSamsung = sUserAgent.match(/sm-/i) == "sm-";
    if (isIphone) {
      window.location.href =
        "https://apps.apple.com/cn/app/%E5%BF%83%E5%8A%A830%E7%A7%92-%E8%AF%AD%E9%9F%B3%E8%81%8A%E5%A4%A9%E4%BA%A4%E5%8F%8B%E5%B9%B3%E5%8F%B0/id1568974512";
      return "iphone";
    } else if (vx || qq) {
      window.location.href =
        "https://static.psychexy.com/install/30s/30s_official_site.apk" +
        "?t=" +
        new Date().getTime();
      // alert("微信！");
      return "default";
    } else if (isHuawei || isHonor) {
      // window.location.href =
      //   "https://appgallery.huawei.com/#/app/C104575683?sharePrepath=ag&locale=zh_CN&source=appshare&subsource=C104575683&shareTo=weixin&shareFrom=appmarket";
      window.location.href = "appmarket://details?id=com.xinyue.xd30seconds";
      return "huawei";
    } else if (isOppo || isOppoR15) {
      window.location.href =
        "oppomarket://details?packagename=com.xinyue.xd30seconds";
      return "oppo";
    } else if (isVivo) {
      // window.location.href =
      //   "https://h5coml.vivo.com.cn/h5coml/appdetail_h5/browser_v2/index.html?appId=3297437&resource=301&source=7";
      window.location.href = "vivomarket://details?id=com.xinyue.xd30seconds";
      return "vivo";
    } else if (isXiaomi || isRedmi || isXiaomi2s) {
      window.location.href = "http://app.xiaomi.com/detail/1402133";
      // window.location.href = "mimarket://details?id=com.xinyue.xd30seconds";
      return "xiaomi";
    } else if (isSamsung) {
      window.location.href =
        "https://static.psychexy.com/install/30s/30s_official_site.apk";
      return "samsung";
    } else {
      window.location.href =
        "https://static.psychexy.com/install/30s/30s_official_site.apk" +
        "?v=" +
        new Date().getTime();
      return "default";
    }
  },
};
</script>

<style>
</style>